import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import TopicsView from '../views/TopicsView.vue'
import DiscussionView from '../views/DiscussionView.vue'
import LearningView from '../views/LearningView.vue'
import SettingView from '../views/SettingView.vue'
import AboutView from '../views/AboutView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/topics',
    name: 'topics',
    component: TopicsView
  },
  {
    path: '/discussion',
    name: 'discussion',
    component: DiscussionView
  },
  {
    path: '/learning',
    name: 'learning',
    component: LearningView
  },
  {
    path: '/setting',
    name: 'setting',
    component: SettingView
  },
  {
    path: '/about',
    name: 'about',
    component: AboutView
  }
]

const router = new VueRouter({
  // mode: 'history', // TODO: 2024-08-04-ljp: 启用历史模式(暂时不开启, 使用默认的哈希模式方便编程)
  routes
})

export default router
